﻿using System;
using System.Collections.Generic;
using ZyGames.DZPocker.Model;
using ZyGames.Framework.Cache.Generic;
using ZyGames.Framework.Game.Cache;
using ZyGames.Framework.Game.Context;
using ZyGames.Framework.Game.Contract;
using ZyGames.Framework.Game.Contract.Action;
using ZyGames.Framework.Game.Lang;
using ZyGames.Framework.Game.Service;
using System.Linq;
using ZyGames.DZPocker.Bll.Logic;
using ZyGames.DZPocker.Script;
using ZyGames.Framework.Net;
using ZyGames.Framework.Common.Serialization;
using System.Threading;

namespace ZyGames.DZPocker.Script.CsScript.Action
{
	/// <summary>
	/// 弹出申请筹码框
	/// </summary>
	public class Action30051 : BaseAction
	{
		private int tableId;
		/// <summary>
		/// 可申请的最小的筹码数量
		/// </summary>
		private int minChip;
		/// <summary>
		/// 可申请的最大筹码数量
		/// </summary>
		private int maxChip;

		private string tableName;
		private int smallChip;
		private int bigChip;
		private int defaultChip;

		public Action30051(HttpGet actionGetter)
			: base((short)ActionType.DZShowApplyChipInfoTip, actionGetter)
		{
		}
		public override bool GetUrlElement()
		{
			if (httpGet.GetInt("TableId", ref tableId) &&
				httpGet.GetInt("MinApplyChip", ref minChip) &&
				httpGet.GetInt("MaxApplyChip", ref maxChip) &&
				httpGet.GetString("TableName", ref tableName) &&
				httpGet.GetInt("SmallChip", ref smallChip) &&
				httpGet.GetInt("BigChip", ref bigChip) &&
				httpGet.GetInt("DefaultChip", ref defaultChip))
			{
				return true;
			}
			return false;
		}

		public override bool TakeAction()
		{
			return true;
		}

		public override void BuildPacket()
		{
			this.PushIntoStack(this.tableId);
			this.PushIntoStack(this.minChip);
			this.PushIntoStack(this.maxChip);
			this.PushIntoStack(this.tableName);
			this.PushIntoStack(this.smallChip);
			this.PushIntoStack(this.bigChip);
			this.PushIntoStack(this.defaultChip);
		}
	}
}
